import {request} from './utils/request'
App({
  globalData:{
    isLogin:false,
    // 是否有音乐在播放
    isPlay:false,
    musicId:"",
    startMapList:[],
    musicList:[],
    index:0,
    currentTime:"",
    backgroundAudioManager:"",
  },
  /**
   * 当小程序初始化完成时，会触发 onLaunch（全局只触发一次）
   */
  onLaunch: async function () {
    let musicListData = await request('/music')
    this.globalData.musicList = musicListData.data
    let playHistory = wx.getStorageSync('playHistory')
    if(!playHistory){
      wx.setStorageSync("playHistory",[])
    }
  },
})
